package com.atom.process.cnmuseum.bm.dao.process;


import java.util.List;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Repository;

import com.atom.common.dao.AvensCommonDao;
import com.atom.common.mb.entity.gl.DbrwDO;
import com.atom.common.remote.user.UserUtil;
import com.atom.process.cnmuseum.bm.entity.process.BmDbrwProcessDO;

@Repository
public class BmDbrwProcessDao extends AvensCommonDao<BmDbrwProcessDO> {
    public List<BmDbrwProcessDO> findByProcessInstanceId(String processId) {
        List<BmDbrwProcessDO> list = super.findByProperty("processId", processId);
        return list;
    }


    public void createPDO(UserUtil user, String processInstanceId, String title, DbrwDO dbrw) {
        BmDbrwProcessDO pdo = new BmDbrwProcessDO();
        BeanUtils.copyProperties(dbrw, pdo, "id");
        pdo.setProcessId(processInstanceId);
        super.save(pdo);
    }

}
